package com.zhz.dao;

import java.util.List;

import com.zhz.pojo.User;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
	/**
	 * ??????
	 *
	 * @param user
	 * @return @
	 */
	public int add(User user);

	/**
	 * ??userCode??User
	 *
	 * @param userCode
	 * @return @
	 */
	public User getLoginUser(String userCode);

	/**
	 * ??????-userList
	 *
	 * @param userName
	 * @param userRole
	 * @return @
	 */
	public List<User> getUserList(@Param("userName") String userName,
                                  @Param("userRole") int userRole,
                                  @Param("currentPageNo") int currentPageNo,
                                  @Param("pageSize") int pageSize);

	/**
	 * ??????-??????
	 *
	 * @param userName
	 * @param userRole
	 * @return @
	 */
	public int getUserCount(@Param("userName") String userName,
                            @Param("userRole") int userRole);

	/**
	 * ??userId??user
	 * 
	 * @param delId
	 * @return @
	 */
	public int deleteUserById(Integer delId);

	/**
	 * ??userId??user
	 * 
	 * @param id
	 * @return @
	 */
	public User getUserById(String id);

	/**
	 * ??????
	 *
	 * @param user
	 * @return @
	 */
	public int modify(User user);

	/**
	 * ????????
	 *
	 * @param id
	 * @param pwd
	 * @return @
	 */
	public int updatePwd(@Param("id") int id, @Param("pwd") String pwd);

}
